package com.cellulam.framework.core.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.collections.CollectionUtils;

import java.io.Serializable;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BatchProcessResult<T> implements Serializable {
    /**
     * 成功
     */
    private List<T> success;

    /**
     * 失败
     */
    private List<T> fail;

    public Integer getSuccessCount() {
        return CollectionUtils.isEmpty(success) ? 0 : success.size();
    }

    public Integer getFailCount() {
        return CollectionUtils.isEmpty(fail) ? 0 : fail.size();
    }
}
